package net.borlis.sample.horses.core;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Alexander on 21.12.2014.
 */
public class Odds extends HashMap<Horse, Integer> {


    public void setWinnerHorse(String horseNumber) {
        for (Map.Entry<Horse, Integer> entry : this.entrySet()) {
            if (entry.getKey().getId().equals(new Integer(horseNumber))) {
                this.put(entry.getKey(), 10);
                break;
            }
        }
    }

    public void print() {
        int index = 1;
        for (Map.Entry<Horse, Integer> entry : this.entrySet()) {
            System.out.println(index + ". horse num " + entry.getKey().getId() + ". '" + entry.getKey().getName() + "' chances: " + entry.getValue()+"/10");
            index++;
        }
    }
}
